Skip to content

Fix ordering of applying styles#725

Merged
cvanelteren merged 5 commits into
mainfrom
fix/dark-axis-format-state
Jun 3, 2026
Merged

Fix ordering of applying styles#725
cvanelteren merged 5 commits into
mainfrom
fix/dark-axis-format-state

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

Rework axis formatting so explicit axis and tick styling persists across repeated format calls without freezing theme defaults, and route generic format aliases consistently through subplot and figure formatting paths. This fixes the dark-mode regressions on alternate axes, restores polar frame styling after the shared helper split, and adds regression coverage for persistence, clearing overrides, and theme transitions.

…oss repeated format calls without freezing theme defaults, and route generic format aliases consistently through subplot and figure formatting paths. This fixes the dark-mode regressions on alternate axes, restores polar frame styling after the shared helper split, and adds regression coverage for persistence, clearing overrides, and theme transitions.
@cvanelteren cvanelteren marked this pull request as draft May 13, 2026 07:39
…n formatting all derive their generic alias handling from one shared schema instead of repeated manual key lists. This keeps the explicit override model intact while making format-key dispatch and persistence much easier to maintain as new axis styling options are added.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 96.21849% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/axes/_formatting.py 80.00% 5 Missing and 1 partial ⚠️
ultraplot/axes/shared.py 82.35% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

PR #725's refactor of axis-format routing dropped two real things:

* User-supplied lw= / ec= / edgecolor= (and axis-prefixed
  xlw=, xec=, …) no longer reach the spines, because
  `_merge_axis_style_state` only looks for the canonical `linewidth` /
  `color` names listed in `_AXIS_STYLE_FIELD_TEMPLATES`. The old
  `_update_background` path used to alias them via `_pop_props` and apply
  them to spines and ticks; that branch is gone now, so on this PR
  `format(ec='black', lw=1.4)` silently rendered default-thin default-color
  spines (visible in the test_uneven_span_subplots regression).

  Add the short aliases as additional sources for the `color` and
  `linewidth` schema fields so the existing merge logic picks them up.

* `_resolve_axis_format` has `tickwidth = get("tickwidth")` immediately
  followed by an unconditional reassignment of `tickwidth` from
  `prev`/`rc` fallbacks, throwing the `get("tickwidth")` value away. The
  result is the same in the test cases that exercise it today because
  `prev` carries the user-supplied value too, but the dead line is
  misleading and a foot-gun. Fold `get("tickwidth")` into the
  `_not_none` chain the same way `ticklen` / `tickwidthratio` already do.

1370 tests pass on the full suite.
@cvanelteren cvanelteren marked this pull request as ready for review June 3, 2026 01:14
@cvanelteren cvanelteren merged commit c218be9 into main Jun 3, 2026
12 of 16 checks passed
@cvanelteren cvanelteren deleted the fix/dark-axis-format-state branch June 3, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant